{% extends "WebMainSiteBundle:Course:layout.html.twig" %}
{% set title = "课程目录" %}
{% block title %}
    {{ title }}
{% endblock %}

{% block user_main %}

    {% set types = ["图文","视频","音频"] %}
    <section class="comments">
        <h2 class="yahei">课程内容</h2>
        <hr/>
        <ul class="media-list">
            <li class="media">
                <div class="media-body">
                {% for row in courseLessonArrange %}
                    <div class="media" style="padding-left: {{ row.level * 3 }}0px">
                        <div class="media-body">
                            {#<div class="media-heading">#}
                                <strong>{{ row.title }}</strong>
                                <a href="{{ path("WebCourseLessonArrangeAdd",{uniqueId:course.uniqueId}) }}?id={{ row.id }}" class="pull-right btn btn-green" style="margin-right: 5px;"><i class="fa fa-cogs"></i> 编辑</a>
                                <a href="{{ path("WebCourseLessonContentAdd",{uniqueId:course.uniqueId}) }}?arrange={{ row.id }}" class="pull-right btn btn-green" style="margin-right: 5px;"><i class="fa fa-plus"></i> 添加课时到章节</a>
                            {#</div>#}
                            {#<p>{{ row.info |slice(0,80) }}</p>#}
                        </div>
                        {% for lesson in row.lessons %}
                            <div class="media" style="padding-left: 30px">
                                <hr/>
                                <div class="media-body">
                                    {#<div class="media-heading">#}
                                        {#<a href="{{ path("WebCourseLessonContentAdd",{uniqueId:course.uniqueId}) }}?arrange={{ row.id }}" class="pull-right btn btn-dark"><i class="fa fa-plus"></i> 添加课时到章节</a>#}
                                        <a href="{{ path("WebCourseLessonContentAdd",{uniqueId:course.uniqueId}) }}?id={{ lesson.id }}" class="pull-right btn btn-green" style="margin-right: 5px;"><i class="fa fa-cogs"></i> 编辑</a>
                                        <strong class="pull-right " style="margin-right: 25px;"><em class="pull-right">[{{ types[lesson.type] }}]</em> {{ lesson.title }} </strong>
                                    {#</div>#}
                                    {#<p>{{ lesson.info |slice(0,80) }}</p>#}
                                </div>
                            </div>
                        {% endfor %}

                    </div>
                    <hr/>
                {% endfor %}
                </div>
            </li>
        </ul>
        <hr class="invisible" />
    </section>


    {#<h1>所有课时</h1>#}
    {#<h3>课程信息</h3>#}
    {#{{ dump(course) }}#}
    {#<b>课程管理：</b>#}
    {#<a href="{{ path("WebCourseInfoAdd",{id:course.id}) }}">编辑[遨游浏览器内有BUG，待解决]</a>#}
    {#<a href="{{ path("WebCourseLessonArrangeAdd",{uniqueId:course.uniqueId}) }}">添加章节</a>#}
    {#<a href="{{ path("WebCourseLessonArrangeList",{uniqueId:course.uniqueId}) }}">课程章节列表</a>#}
    {#<h3>课程内容</h3>#}
    {#{% for row in courseLessonArrange %}#}

        {#<p>#}
            {#<a>{{ row.title }}</a>#}
            {#<a style="font-size: 12px;">{{ row.info | slice(0,30)}}</a>#}
            {#<b>章节管理：</b>#}
            {#<a href="{{ path("WebCourseLessonContentAdd",{uniqueId:course.uniqueId}) }}?arrange={{ row.id }}">添加课时</a>#}
            {#<div style="padding-left: 20px;">#}
            {#{% for lesson in row.lessons %}#}
                {#<p>#}
                    {#<a>{{ lesson.title }}</a>#}
                    {#<b>课时管理：</b><a href="{{ path("WebCourseLessonContentAdd",{uniqueId:course.uniqueId}) }}?id={{ lesson.id }}">编辑课时</a>#}
                {#</p>#}
            {#{% endfor %}#}
            {#</div>#}

        {#</p>#}
    {#{% endfor %}#}
{% endblock %}